/**
 */
package org.mro.grib.model.files.secondEdition.dataRepresentations.impl;

import java.nio.ByteBuffer;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationTemplate52;
import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationsPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Data Representation Template52</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getGroupSplittingMethod <em>Group Splitting Method</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getMissingValueManagement <em>Missing Value Management</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getPrimaryMissingValueSubstitute <em>Primary Missing Value Substitute</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getSecondaryMissingValueSubstitute <em>Secondary Missing Value Substitute</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getNg <em>Ng</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getReferenceForGroupWidths <em>Reference For Group Widths</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getGroupWidthsNumberOfBits <em>Group Widths Number Of Bits</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getReferenceForGroupLengths <em>Reference For Group Lengths</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getGroupLengthsIncrement <em>Group Lengths Increment</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getTrueLengthOfLastGroup <em>True Length Of Last Group</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate52Impl#getScaledGroupLengthNumberOfBits <em>Scaled Group Length Number Of Bits</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DataRepresentationTemplate52Impl extends DataRepresentationTemplate50Impl implements DataRepresentationTemplate52 {
	/**
	 * The default value of the '{@link #getGroupSplittingMethod() <em>Group Splitting Method</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupSplittingMethod()
	 * @generated
	 * @ordered
	 */
	protected static final byte GROUP_SPLITTING_METHOD_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getGroupSplittingMethod() <em>Group Splitting Method</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupSplittingMethod()
	 * @generated
	 * @ordered
	 */
	protected byte groupSplittingMethod = GROUP_SPLITTING_METHOD_EDEFAULT;

	/**
	 * The default value of the '{@link #getMissingValueManagement() <em>Missing Value Management</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMissingValueManagement()
	 * @generated
	 * @ordered
	 */
	protected static final byte MISSING_VALUE_MANAGEMENT_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getMissingValueManagement() <em>Missing Value Management</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMissingValueManagement()
	 * @generated
	 * @ordered
	 */
	protected byte missingValueManagement = MISSING_VALUE_MANAGEMENT_EDEFAULT;

	/**
	 * The default value of the '{@link #getPrimaryMissingValueSubstitute() <em>Primary Missing Value Substitute</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrimaryMissingValueSubstitute()
	 * @generated
	 * @ordered
	 */
	protected static final int PRIMARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getPrimaryMissingValueSubstitute() <em>Primary Missing Value Substitute</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrimaryMissingValueSubstitute()
	 * @generated
	 * @ordered
	 */
	protected int primaryMissingValueSubstitute = PRIMARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT;

	/**
	 * The default value of the '{@link #getSecondaryMissingValueSubstitute() <em>Secondary Missing Value Substitute</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondaryMissingValueSubstitute()
	 * @generated
	 * @ordered
	 */
	protected static final int SECONDARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getSecondaryMissingValueSubstitute() <em>Secondary Missing Value Substitute</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondaryMissingValueSubstitute()
	 * @generated
	 * @ordered
	 */
	protected int secondaryMissingValueSubstitute = SECONDARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT;

	/**
	 * The default value of the '{@link #getNg() <em>Ng</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNg()
	 * @generated
	 * @ordered
	 */
	protected static final int NG_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getNg() <em>Ng</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNg()
	 * @generated
	 * @ordered
	 */
	protected int ng = NG_EDEFAULT;

	/**
	 * The default value of the '{@link #getReferenceForGroupWidths() <em>Reference For Group Widths</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferenceForGroupWidths()
	 * @generated
	 * @ordered
	 */
	protected static final byte REFERENCE_FOR_GROUP_WIDTHS_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getReferenceForGroupWidths() <em>Reference For Group Widths</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferenceForGroupWidths()
	 * @generated
	 * @ordered
	 */
	protected byte referenceForGroupWidths = REFERENCE_FOR_GROUP_WIDTHS_EDEFAULT;

	/**
	 * The default value of the '{@link #getGroupWidthsNumberOfBits() <em>Group Widths Number Of Bits</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupWidthsNumberOfBits()
	 * @generated
	 * @ordered
	 */
	protected static final byte GROUP_WIDTHS_NUMBER_OF_BITS_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getGroupWidthsNumberOfBits() <em>Group Widths Number Of Bits</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupWidthsNumberOfBits()
	 * @generated
	 * @ordered
	 */
	protected byte groupWidthsNumberOfBits = GROUP_WIDTHS_NUMBER_OF_BITS_EDEFAULT;

	/**
	 * The default value of the '{@link #getReferenceForGroupLengths() <em>Reference For Group Lengths</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferenceForGroupLengths()
	 * @generated
	 * @ordered
	 */
	protected static final int REFERENCE_FOR_GROUP_LENGTHS_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getReferenceForGroupLengths() <em>Reference For Group Lengths</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReferenceForGroupLengths()
	 * @generated
	 * @ordered
	 */
	protected int referenceForGroupLengths = REFERENCE_FOR_GROUP_LENGTHS_EDEFAULT;

	/**
	 * The default value of the '{@link #getGroupLengthsIncrement() <em>Group Lengths Increment</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupLengthsIncrement()
	 * @generated
	 * @ordered
	 */
	protected static final byte GROUP_LENGTHS_INCREMENT_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getGroupLengthsIncrement() <em>Group Lengths Increment</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getGroupLengthsIncrement()
	 * @generated
	 * @ordered
	 */
	protected byte groupLengthsIncrement = GROUP_LENGTHS_INCREMENT_EDEFAULT;

	/**
	 * The default value of the '{@link #getTrueLengthOfLastGroup() <em>True Length Of Last Group</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTrueLengthOfLastGroup()
	 * @generated
	 * @ordered
	 */
	protected static final int TRUE_LENGTH_OF_LAST_GROUP_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getTrueLengthOfLastGroup() <em>True Length Of Last Group</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTrueLengthOfLastGroup()
	 * @generated
	 * @ordered
	 */
	protected int trueLengthOfLastGroup = TRUE_LENGTH_OF_LAST_GROUP_EDEFAULT;

	/**
	 * The default value of the '{@link #getScaledGroupLengthNumberOfBits() <em>Scaled Group Length Number Of Bits</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getScaledGroupLengthNumberOfBits()
	 * @generated
	 * @ordered
	 */
	protected static final byte SCALED_GROUP_LENGTH_NUMBER_OF_BITS_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getScaledGroupLengthNumberOfBits() <em>Scaled Group Length Number Of Bits</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getScaledGroupLengthNumberOfBits()
	 * @generated
	 * @ordered
	 */
	protected byte scaledGroupLengthNumberOfBits = SCALED_GROUP_LENGTH_NUMBER_OF_BITS_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DataRepresentationTemplate52Impl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DataRepresentationsPackage.Literals.DATA_REPRESENTATION_TEMPLATE52;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getGroupSplittingMethod() {
		return groupSplittingMethod;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGroupSplittingMethod(byte newGroupSplittingMethod) {
		byte oldGroupSplittingMethod = groupSplittingMethod;
		groupSplittingMethod = newGroupSplittingMethod;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_SPLITTING_METHOD, oldGroupSplittingMethod, groupSplittingMethod));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getMissingValueManagement() {
		return missingValueManagement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMissingValueManagement(byte newMissingValueManagement) {
		byte oldMissingValueManagement = missingValueManagement;
		missingValueManagement = newMissingValueManagement;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__MISSING_VALUE_MANAGEMENT, oldMissingValueManagement, missingValueManagement));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getPrimaryMissingValueSubstitute() {
		return primaryMissingValueSubstitute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPrimaryMissingValueSubstitute(int newPrimaryMissingValueSubstitute) {
		int oldPrimaryMissingValueSubstitute = primaryMissingValueSubstitute;
		primaryMissingValueSubstitute = newPrimaryMissingValueSubstitute;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__PRIMARY_MISSING_VALUE_SUBSTITUTE, oldPrimaryMissingValueSubstitute, primaryMissingValueSubstitute));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getSecondaryMissingValueSubstitute() {
		return secondaryMissingValueSubstitute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSecondaryMissingValueSubstitute(int newSecondaryMissingValueSubstitute) {
		int oldSecondaryMissingValueSubstitute = secondaryMissingValueSubstitute;
		secondaryMissingValueSubstitute = newSecondaryMissingValueSubstitute;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SECONDARY_MISSING_VALUE_SUBSTITUTE, oldSecondaryMissingValueSubstitute, secondaryMissingValueSubstitute));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getNg() {
		return ng;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNg(int newNg) {
		int oldNg = ng;
		ng = newNg;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__NG, oldNg, ng));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getReferenceForGroupWidths() {
		return referenceForGroupWidths;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setReferenceForGroupWidths(byte newReferenceForGroupWidths) {
		byte oldReferenceForGroupWidths = referenceForGroupWidths;
		referenceForGroupWidths = newReferenceForGroupWidths;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_WIDTHS, oldReferenceForGroupWidths, referenceForGroupWidths));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getGroupWidthsNumberOfBits() {
		return groupWidthsNumberOfBits;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGroupWidthsNumberOfBits(byte newGroupWidthsNumberOfBits) {
		byte oldGroupWidthsNumberOfBits = groupWidthsNumberOfBits;
		groupWidthsNumberOfBits = newGroupWidthsNumberOfBits;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_WIDTHS_NUMBER_OF_BITS, oldGroupWidthsNumberOfBits, groupWidthsNumberOfBits));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getReferenceForGroupLengths() {
		return referenceForGroupLengths;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setReferenceForGroupLengths(int newReferenceForGroupLengths) {
		int oldReferenceForGroupLengths = referenceForGroupLengths;
		referenceForGroupLengths = newReferenceForGroupLengths;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_LENGTHS, oldReferenceForGroupLengths, referenceForGroupLengths));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getGroupLengthsIncrement() {
		return groupLengthsIncrement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setGroupLengthsIncrement(byte newGroupLengthsIncrement) {
		byte oldGroupLengthsIncrement = groupLengthsIncrement;
		groupLengthsIncrement = newGroupLengthsIncrement;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_LENGTHS_INCREMENT, oldGroupLengthsIncrement, groupLengthsIncrement));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getTrueLengthOfLastGroup() {
		return trueLengthOfLastGroup;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTrueLengthOfLastGroup(int newTrueLengthOfLastGroup) {
		int oldTrueLengthOfLastGroup = trueLengthOfLastGroup;
		trueLengthOfLastGroup = newTrueLengthOfLastGroup;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__TRUE_LENGTH_OF_LAST_GROUP, oldTrueLengthOfLastGroup, trueLengthOfLastGroup));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getScaledGroupLengthNumberOfBits() {
		return scaledGroupLengthNumberOfBits;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setScaledGroupLengthNumberOfBits(byte newScaledGroupLengthNumberOfBits) {
		byte oldScaledGroupLengthNumberOfBits = scaledGroupLengthNumberOfBits;
		scaledGroupLengthNumberOfBits = newScaledGroupLengthNumberOfBits;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SCALED_GROUP_LENGTH_NUMBER_OF_BITS, oldScaledGroupLengthNumberOfBits, scaledGroupLengthNumberOfBits));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_SPLITTING_METHOD:
				return getGroupSplittingMethod();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__MISSING_VALUE_MANAGEMENT:
				return getMissingValueManagement();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__PRIMARY_MISSING_VALUE_SUBSTITUTE:
				return getPrimaryMissingValueSubstitute();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SECONDARY_MISSING_VALUE_SUBSTITUTE:
				return getSecondaryMissingValueSubstitute();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__NG:
				return getNg();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_WIDTHS:
				return getReferenceForGroupWidths();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_WIDTHS_NUMBER_OF_BITS:
				return getGroupWidthsNumberOfBits();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_LENGTHS:
				return getReferenceForGroupLengths();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_LENGTHS_INCREMENT:
				return getGroupLengthsIncrement();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__TRUE_LENGTH_OF_LAST_GROUP:
				return getTrueLengthOfLastGroup();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SCALED_GROUP_LENGTH_NUMBER_OF_BITS:
				return getScaledGroupLengthNumberOfBits();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_SPLITTING_METHOD:
				setGroupSplittingMethod((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__MISSING_VALUE_MANAGEMENT:
				setMissingValueManagement((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__PRIMARY_MISSING_VALUE_SUBSTITUTE:
				setPrimaryMissingValueSubstitute((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SECONDARY_MISSING_VALUE_SUBSTITUTE:
				setSecondaryMissingValueSubstitute((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__NG:
				setNg((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_WIDTHS:
				setReferenceForGroupWidths((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_WIDTHS_NUMBER_OF_BITS:
				setGroupWidthsNumberOfBits((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_LENGTHS:
				setReferenceForGroupLengths((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_LENGTHS_INCREMENT:
				setGroupLengthsIncrement((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__TRUE_LENGTH_OF_LAST_GROUP:
				setTrueLengthOfLastGroup((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SCALED_GROUP_LENGTH_NUMBER_OF_BITS:
				setScaledGroupLengthNumberOfBits((Byte)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_SPLITTING_METHOD:
				setGroupSplittingMethod(GROUP_SPLITTING_METHOD_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__MISSING_VALUE_MANAGEMENT:
				setMissingValueManagement(MISSING_VALUE_MANAGEMENT_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__PRIMARY_MISSING_VALUE_SUBSTITUTE:
				setPrimaryMissingValueSubstitute(PRIMARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SECONDARY_MISSING_VALUE_SUBSTITUTE:
				setSecondaryMissingValueSubstitute(SECONDARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__NG:
				setNg(NG_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_WIDTHS:
				setReferenceForGroupWidths(REFERENCE_FOR_GROUP_WIDTHS_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_WIDTHS_NUMBER_OF_BITS:
				setGroupWidthsNumberOfBits(GROUP_WIDTHS_NUMBER_OF_BITS_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_LENGTHS:
				setReferenceForGroupLengths(REFERENCE_FOR_GROUP_LENGTHS_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_LENGTHS_INCREMENT:
				setGroupLengthsIncrement(GROUP_LENGTHS_INCREMENT_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__TRUE_LENGTH_OF_LAST_GROUP:
				setTrueLengthOfLastGroup(TRUE_LENGTH_OF_LAST_GROUP_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SCALED_GROUP_LENGTH_NUMBER_OF_BITS:
				setScaledGroupLengthNumberOfBits(SCALED_GROUP_LENGTH_NUMBER_OF_BITS_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_SPLITTING_METHOD:
				return groupSplittingMethod != GROUP_SPLITTING_METHOD_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__MISSING_VALUE_MANAGEMENT:
				return missingValueManagement != MISSING_VALUE_MANAGEMENT_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__PRIMARY_MISSING_VALUE_SUBSTITUTE:
				return primaryMissingValueSubstitute != PRIMARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SECONDARY_MISSING_VALUE_SUBSTITUTE:
				return secondaryMissingValueSubstitute != SECONDARY_MISSING_VALUE_SUBSTITUTE_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__NG:
				return ng != NG_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_WIDTHS:
				return referenceForGroupWidths != REFERENCE_FOR_GROUP_WIDTHS_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_WIDTHS_NUMBER_OF_BITS:
				return groupWidthsNumberOfBits != GROUP_WIDTHS_NUMBER_OF_BITS_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__REFERENCE_FOR_GROUP_LENGTHS:
				return referenceForGroupLengths != REFERENCE_FOR_GROUP_LENGTHS_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__GROUP_LENGTHS_INCREMENT:
				return groupLengthsIncrement != GROUP_LENGTHS_INCREMENT_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__TRUE_LENGTH_OF_LAST_GROUP:
				return trueLengthOfLastGroup != TRUE_LENGTH_OF_LAST_GROUP_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE52__SCALED_GROUP_LENGTH_NUMBER_OF_BITS:
				return scaledGroupLengthNumberOfBits != SCALED_GROUP_LENGTH_NUMBER_OF_BITS_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (groupSplittingMethod: "); //$NON-NLS-1$
		result.append(groupSplittingMethod);
		result.append(", missingValueManagement: "); //$NON-NLS-1$
		result.append(missingValueManagement);
		result.append(", primaryMissingValueSubstitute: "); //$NON-NLS-1$
		result.append(primaryMissingValueSubstitute);
		result.append(", secondaryMissingValueSubstitute: "); //$NON-NLS-1$
		result.append(secondaryMissingValueSubstitute);
		result.append(", ng: "); //$NON-NLS-1$
		result.append(ng);
		result.append(", referenceForGroupWidths: "); //$NON-NLS-1$
		result.append(referenceForGroupWidths);
		result.append(", groupWidthsNumberOfBits: "); //$NON-NLS-1$
		result.append(groupWidthsNumberOfBits);
		result.append(", referenceForGroupLengths: "); //$NON-NLS-1$
		result.append(referenceForGroupLengths);
		result.append(", groupLengthsIncrement: "); //$NON-NLS-1$
		result.append(groupLengthsIncrement);
		result.append(", trueLengthOfLastGroup: "); //$NON-NLS-1$
		result.append(trueLengthOfLastGroup);
		result.append(", scaledGroupLengthNumberOfBits: "); //$NON-NLS-1$
		result.append(scaledGroupLengthNumberOfBits);
		result.append(')');
		return result.toString();
	}

	/* (non-Javadoc)
	 * @see org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate50Impl#initialise(java.nio.ByteBuffer)
	 */
	@Override
	public void initialise(ByteBuffer buffer) {
		super.initialise(buffer);
		groupSplittingMethod = buffer.get();
		missingValueManagement = buffer.get();
		primaryMissingValueSubstitute = buffer.getInt();
		secondaryMissingValueSubstitute = buffer.getInt();
		ng = buffer.getInt();
		referenceForGroupWidths = buffer.get();
		groupWidthsNumberOfBits = buffer.get();
		referenceForGroupLengths = buffer.getInt();
		groupLengthsIncrement = buffer.get();
		trueLengthOfLastGroup = buffer.getInt();
		scaledGroupLengthNumberOfBits = buffer.get();
	}
	
} //DataRepresentationTemplate52Impl
